<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateBannerTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('banner', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->string('title', 30)->default('')->comment('Banner标题');
            $table->string('poster', 50)->default('')->comment('Banner图片地址');
            $table->tinyInteger('channel')->default(0)->comment('频道:0-全部');
            $table->tinyInteger('jump_type')->default(1)->comment('跳转类型');
            $table->string('jump_info', 200)->default('')->comment('跳转信息');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('状态：0-无效，1-有效');
            $table->dateTime('begin_at')->default('1990-01-01 00:00:00')->comment('开始时间');
            $table->dateTime('end_at')->default('1990-01-01 00:00:00')->comment('结束时间');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('banner');
    }
}
